package de.fhhannover.inform.hnefatafl.gui;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;

public class DefenderOption extends JPanel{
	
	private static final long serialVersionUID = 1L;
	
	public JRadioButton defenderOption1;
	public JRadioButton defenderOption2;
	public ButtonGroup  defender;
	public JLabel       label;
	public JTextField   nameField;
	public JLabel		strategyLabel;
	public JButton		strategyChoser;
	public JComboBox 	groupNummer;
	public JComboBox	groupStrategy;
	
	public DefenderOption(){
		this.setLayout(new GridLayout(3, 2));
		this.setBorder(new TitledBorder(new EtchedBorder(), "Verteidiger"));
		
		defender = new ButtonGroup();
		
		defenderOption1 = new JRadioButton("Spieler  ");
		defender.add(defenderOption1);
		this.add(defenderOption1);
		
		defenderOption2 = new JRadioButton("KI");
		defender.add(defenderOption2);
		this.add(defenderOption2);
		defenderOption2.setSelected(true);
		
		label = new JLabel(" :Name",SwingConstants.LEFT);
		nameField = new JTextField("Verteidiger");
		label.setLabelFor(nameField);
			
		this.add(nameField);
		this.add(label);
		
		strategyChoser = new JButton("<<<");
		this.add(strategyChoser);
		
		strategyChoser.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				GUIController.getInstance().showDefenderStrategy();		
			}});
		
		strategyLabel = new JLabel(" :Strategy",SwingConstants.LEFT);
		this.add(strategyLabel);
		
//		groupNummer = new JComboBox();
//		this.add(groupNummer);
//		groupStrategy = new JComboBox();
//		this.add(groupStrategy);	
		
	}

}
